<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description"
          content="A layout example with a side menu that hides on mobile, just like the Pure website.">
    <title>Netstat是 &ndash; Pure</title>
    <link rel="stylesheet" href="https://purecss.io/css/pure/pure-min.css">
    <link rel="stylesheet" href="https://purecss.io/layouts/side-menu/styles.css">
    <style>
    tbody tr:nth-child(even){
        background-color: #f6f5f5;
    }
    .current-session{
        background-color: #e8e779 !important;;
    }
    </style>
</head>
<body>™™

<div id="layout">
    <!-- Menu toggle -->
    <a href="#menu" id="menuLink" class="menu-link">
        <!-- Hamburger icon -->
        <span></span>
    </a>

    <div id="menu">
        <div class="pure-menu">
            <!-- <a class="pure-menu-heading" href="#netstat">Netstat</a> -->

            <ul class="pure-menu-list">
                <!-- <li class="pure-menu-item"><a href="#home" class="pure-menu-link">Home</a></li> -->

                <li class="pure-menu-item menu-item-divided pure-menu-selected">
                    <a href="#" class="pure-menu-link">Netstat</a>
                </li>

                <!-- <li class="pure-menu-item"><a href="#contact" class="pure-menu-link">Contact</a></li> -->
            </ul>
        </div>
    </div>

    <div id="main">
        <div class="header">
            <h1>Netstat</h1>
            <h2>
                <span>hostname: {{ .Hostname }}</span>&nbsp;
                <span>IP: {{ .IP }}</span>&nbsp;
                <span>ClientAddr: {{ .ClientAddr }}</span>
            </h2>
        </div>

        <div class="content">
<!--            <h2 class="content-subhead">Netstat results</h2>-->
            <p>
            <table class="pure-table">
                <thead>
                <tr>
                    <th>#</th>
                    <th>Proto</th>
                    <th>Recv</th>
                    <th>Send</th>
                    <th>Local Address</th>
                    <th>Foreign Address</th>
                    <th>State</th>
                    <th>PID</th>
                    <th>RSS</th>
                    <th>%CPU</th>
                    <th>ProgramName</th>
                </tr>
                </thead>

                <tbody>

                {{range .NetstatLines}}

                {{ if .CurrentSession }}
                <tr class="current-session">
                    {{ else }}
                <tr>
                    {{ end }}

                    <td>{{.Seq           }}</td>
                    <td>{{.Proto         }}</td>
                    <td>{{.Recv          }}</td>
                    <td>{{.Send          }}</td>
                    <td>{{.LocalAddress  }}</td>
                    <td>{{.ForeignAddress}}</td>
                    <td>{{.State         }}</td>
                    <td>{{.PidProgram    }}</td>
                    <td>{{.RES    }}</td>
                    <td>{{.PCPU    }}</td>
                    <td>{{.ProgramName    }}</td>
                </tr>
                {{end}}

                </tbody>
            </table>
            </p>
        </div>
    </div>
</div>

<script src="https://purecss.io/js/ui.js"></script>

</body>
</html>
